import request from "@/utils/request";

// 查询社区民警列表
export function listPolice(query) {
  return request({
    url: "/police-user/listPage",
    method: "get",
    params: query,
  });
}

// 查询社区民警详细（根据Id查询单个）
export function getPoliceById(query) {
  return request({
    url: "/police-user/selectOne",
    method: "get",
    params: query,
  });
}

// 查询所有民警下拉按社区分组
export function getPoliceGroup(query) {
  return request({
    url: "/police-user/selectListGroup",
    method: "get",
    params: query,
  });
}

// 新增社区民警
export function addPolice(data) {
  return request({
    url: "/police-user/add",
    method: "post",
    data: data,
  });
}

// 修改社区民警
export function updatePolice(data) {
  return request({
    url: "/police-user/update",
    method: "put",
    data: data,
  });
}

// 删除社区民警
export function delPolice(Id) {
  return request({
    url: "/police-user/delete/" + Id,
    method: "delete",
  });
}

// 获取民警打卡记录列表
export function getClockList(query) {
  return request({
    url: "/police-clock/listMonth",
    method: "get",
    params: query,
  });
}

// 获取民警本月打卡天数
export function getClockCount(query) {
  return request({
    url: "/police-clock/clockDay",
    method: "get",
    params: query,
  });
}

// 获取民警报备记录
export function listReport(query) {
  return request({
    url: "/police-clock/reportList",
    method: "get",
    params: query,
  });
}

// 获取民警报备记录
export function listClock(query) {
  return request({
    url: "/police-clock/clockList",
    method: "get",
    params: query,
  });
}

// 民警下拉搜索
export function listPoliceBySearch(query) {
  return request({
    url: "/police-statistics/list",
    method: "get",
    params: query,
  });
}
